﻿using BaseProject.Application.Interfaces;
using BaseProject.Model.ViewModels;
using Microsoft.AspNetCore.Mvc;

namespace BaseProject.Web.ViewComponents
{
    public class UserStatus : ViewComponent
    {
        private readonly IWorkContext _workContext;

        public UserStatus(IWorkContext workContext)
        {
            this._workContext = workContext;
        }

        public IViewComponentResult Invoke()
        {
            var model = new UserStatusVM()
            {
                Id = this._workContext.CurrentUser.Id,
                Name = this._workContext.CurrentUser.Name
            };
            return View(model);
        }
    }
}